package main

import (
	"enotify/internal/xys/notify/job"
	"enotify/pkg/async/conf"
	"fmt"
	"os"
	"os/signal"
	"syscall"
)

func main() {
	conf.Init()
	fmt.Println("start job-----")
	j := job.NewJob(conf.Conf,2)
	j.Start()
	c := make(chan os.Signal, 1)
	signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT)
	for {
		s := <-c
		switch s {
		case syscall.SIGQUIT, syscall.SIGTERM, syscall.SIGINT:
			j.Close()
			return
		case syscall.SIGHUP:
		default:
			return
		}
	}
}
